#pragma once
#ifndef SOUND_H_
#define SOUND_H_

#include "transformobject.h"

namespace EPOC
{
	class AudioManager;
	class MixChunk;
	class Sound : public TransformObject
	{
	public:
		Sound(AudioManager *pAudioManager);
		virtual ~Sound();

		virtual void Cleanup();
		virtual bool Update(float fTimeDelta);

		virtual bool Load(std::string sFilePath);
		virtual bool Play(int nLoops = 0);
		virtual void Stop();
		virtual void Pause();
		virtual void Resume();

		virtual void SetVolume(int nVolume = 100);
		virtual int GetVolume();

		virtual void SetPanning(float fPanning = 0.0f);
		virtual float GetPanning();

		virtual void SetDistance(float fDistance = 0.0f);
		virtual float GetDistance();

		virtual void NotifyChannelDone(int nChannel);

		inline void SetRemoveWhenDone(bool bStatus) { m_bRemoveWhenDone = bStatus;}
		inline bool IsRemovedWhenDone()				{ return m_bRemoveWhenDone;}

		inline bool IsPlaying() { return m_bPlaying;}
		inline bool IsPaused() { return m_bPause;}
		inline bool IsDone() { return m_bDone;}

		inline MixChunk * GetMixChunk() { return m_pMixChunk;}


	protected:
		bool m_bDone;
		bool m_bPlaying;
		bool m_bPause;
		bool m_bRemoveWhenDone;
		
		int m_nVolume;
		int m_nCurrentChannel;
		int m_nLeftPanning;
		int m_nRightPanning;
		int m_nDistance;
		float m_fPanningRatio;
		float m_fDistanceRatio;
		
		MixChunk *m_pMixChunk;
		AudioManager *m_pAudioManager;
	
	}; // class Sound
}; // namespace EPOC

#endif